<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>云玩家 - Yunist</title><meta name="keywords" content="机器学习,网站搭建,数学,白嫖"><meta name="author" content="云玩家"><meta name="copyright" content="云玩家"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="云玩家&#39;s blog">
<meta property="og:type" content="website">
<meta property="og:title" content="云玩家">
<meta property="og:url" content="http://yunist.cn/page/7/index.html">
<meta property="og:site_name" content="云玩家">
<meta property="og:description" content="云玩家&#39;s blog">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://cdn.jsdelivr.net/gh/cnyist/blog/img/avatar.svg">
<meta property="article:author" content="云玩家">
<meta property="article:tag" content="机器学习,网站搭建,数学,白嫖">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://cdn.jsdelivr.net/gh/cnyist/blog/img/avatar.svg"><link rel="shortcut icon" href="/img/favicon.ico"><link rel="canonical" href="http://yunist.cn/page/7/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//s4.cnzz.com"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><script async="async" data-pjax="data-pjax" src="https://s4.cnzz.com/z_stat.php?id=1278869595&amp;web_id=1278869595"></script><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isanchor: false
}</script><script src="/js/yuntools.js"></script><script id="config-diff">var GLOBAL_CONFIG_SITE = { 
  isPost: false,
  isHome: true,
  isHighlightShrink: false,
  isToc: false,
  postUpdate: '2022-01-14 13:28:39'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    })(window)</script><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/cnyist/blog/css/font.css"><meta name="generator" content="Hexo 5.4.0"></head><body><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" src="https://cdn.jsdelivr.net/gh/cnyist/blog/img/avatar.svg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">文章</div><div class="length-num">97</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">标签</div><div class="length-num">40</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">分类</div><div class="length-num">27</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/chat/"><i class="fa-fw fas fa-comments"></i><span> 闲聊室</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-user"></i><span> about</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw iconfont icon-Web"></i><span> 镜像站点</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" target="_blank" rel="noopener" href="https://yunist.gitee.io"><i class="fa-fw iconfont icon-gitee-fill-round"></i><span> Gitee Pages</span></a></li></ul></div></div></div></div><div class="page" id="body-wrap"><header class="full_page" id="page-header" style="background-color:transparent;"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">云玩家</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/chat/"><i class="fa-fw fas fa-comments"></i><span> 闲聊室</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-user"></i><span> about</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw iconfont icon-Web"></i><span> 镜像站点</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" target="_blank" rel="noopener" href="https://yunist.gitee.io"><i class="fa-fw iconfont icon-gitee-fill-round"></i><span> Gitee Pages</span></a></li></ul></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">云玩家</h1><div id="site-subtitle"><span id="subtitle"></span></div><div id="site_social_icons"><a class="social-icon" href="https://github.com/cnyist" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="https://blog.csdn.net/chnyist" target="_blank" title="CSDN"><i class="fas iconfont icon-CN_csdnnet"></i></a><a class="social-icon" href="https://www.zhihu.com/people/cnyist" target="_blank" title="知乎"><i class="fas iconfont icon-zhihu"></i></a><a class="social-icon" href="mailto:yunist@qq.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><!-- - let post_cover = article.cover--><div class="post_cover left_radius"><a href="/ML/RL/primer/RL_demo/" title="强化学习入门 Demo">     <img class="post_bg" src="https://cdn.jsdelivr.net/gh/cnyist/blog/ML/RL/primer/RL_demo/RL_demo.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="强化学习入门 Demo"></a></div><div class="recent-post-info"><a class="article-title" href="/ML/RL/primer/RL_demo/" title="强化学习入门 Demo">强化学习入门 Demo</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-04-27T13:15:24.000Z" title="发表于 2020-04-27 21:15:24">2020-04-27</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/">机器学习</a><i class="fas fa-angle-right"></i><a class="article-meta__categories" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E5%BC%BA%E5%8C%96%E5%AD%A6%E4%B9%A0/">强化学习</a><i class="fas fa-angle-right"></i><a class="article-meta__categories" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E5%BC%BA%E5%8C%96%E5%AD%A6%E4%B9%A0/%E5%85%A5%E9%97%A8/">入门</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/">机器学习</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/Python/">Python</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/%E5%BC%BA%E5%8C%96%E5%AD%A6%E4%B9%A0/">强化学习</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/%E4%BB%A3%E7%A0%81%E5%AE%9E%E4%BE%8B/">代码实例</a></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/ML/RL/primer/RL_demo/#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">Q Learning12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091import numpy as npimport pandas as pdimport timeimport IPythonlength = 4  # 道路长度epsilon = 0.9  # 贪心值a = [0, 1]  # 动作Q_a = np.zeros([length + 1, len(a)])  # Q-a表alpha = 0.1gamma = 0.9game_over = False  # 一轮游戏是否结束def print_environment(state):    &quot;&quot;&quot;打印环境&quot;&quot;&quot;    str = &#x27;-&#x27; * state   ...</div></div></div><div class="recent-post-item"><!-- - let post_cover = article.cover--><div class="post_cover right_radius"><a href="/ML/watermelon_book/read/16/" title="读懂西瓜书 16 : 强化学习">     <img class="post_bg" src="https://cdn.jsdelivr.net/gh/cnyist/blog/ML/watermelon_book/read/16/16.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="读懂西瓜书 16 : 强化学习"></a></div><div class="recent-post-info"><a class="article-title" href="/ML/watermelon_book/read/16/" title="读懂西瓜书 16 : 强化学习">读懂西瓜书 16 : 强化学习</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-04-25T09:06:40.000Z" title="发表于 2020-04-25 17:06:40">2020-04-25</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/">机器学习</a><i class="fas fa-angle-right"></i><a class="article-meta__categories" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E5%BC%BA%E5%8C%96%E5%AD%A6%E4%B9%A0/">强化学习</a><i class="fas fa-angle-right"></i><a class="article-meta__categories" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E8%A5%BF%E7%93%9C%E4%B9%A6/">西瓜书</a><i class="fas fa-angle-right"></i><a class="article-meta__categories" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E5%BC%BA%E5%8C%96%E5%AD%A6%E4%B9%A0/%E5%85%A5%E9%97%A8/">入门</a><i class="fas fa-angle-right"></i><a class="article-meta__categories" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E8%A5%BF%E7%93%9C%E4%B9%A6/%E8%AF%BB%E6%87%82%E8%A5%BF%E7%93%9C%E4%B9%A6/">读懂西瓜书</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/">机器学习</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/%E5%BC%BA%E5%8C%96%E5%AD%A6%E4%B9%A0/">强化学习</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/%E8%A5%BF%E7%93%9C%E4%B9%A6/">西瓜书</a></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/ML/watermelon_book/read/16/#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">K-摇臂赌博机探索与利用探索与利用总是矛盾的, 要使奖赏最大, 就要在探索与利用之间做好权衡.
ϵ-贪心以 $\epsilon$ 的概率进行探索, 以 $1-\epsilon$ 的概率进行利用.
增量式计算令 $Q(k)$ 记录摇臂 $k$ 的平均奖赏. 若摇臂 $k$ 被尝试了 $n$ 次, 得到的奖赏是 $v_1,v_2,\dots,v_n$ , 则平均奖赏为$$Q(k)=\frac{1}{n}\sum_{i=1}^nv_i$$由于如果这样计算的话, 需要记录 $n$ 个奖赏值, 算法效率也不高 ( $\mathcal O(n)$ ) , 所以采用增量式计算.$$\begin{aligned}Q_n(k)&amp;=\frac{1}{n}\big((n-1)\times Q_{n-1}(k)+v_n\big)\\&amp;=Q_{n-1}(k)+\frac{1}{n}\big(v_n-Q_{n-1}(k)\big)\end{aligned}$$这样就只需要记录两个值: 已尝试次数 $n-1$ 以及最近平均奖赏 $Q_{n-1}(k)$ . 算法复杂度也下降到 $\mathcal O ...</div></div></div><div class="recent-post-item"><!-- - let post_cover = article.cover--><div class="post_cover left_radius"><a href="/scribble/obsessive_LaTeX/" title="强迫症的 LaTeX">     <img class="post_bg" src="https://cdn.jsdelivr.net/gh/cnyist/blog/scribble/obsessive_LaTeX/obsessive_LaTeX.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="强迫症的 LaTeX"></a></div><div class="recent-post-info"><a class="article-title" href="/scribble/obsessive_LaTeX/" title="强迫症的 LaTeX">强迫症的 LaTeX</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-04-23T10:44:00.000Z" title="发表于 2020-04-23 18:44:00">2020-04-23</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E6%9D%82%E6%96%87/">杂文</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/LaTeX/">LaTeX</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/%E6%95%B0%E5%AD%A6/">数学</a></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/scribble/obsessive_LaTeX/#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">这篇博文写了一些关于数学公式的规范. 为啥写这个呢, 因为规范了自己数学公式的写法, 才能更有效率的写数学公式. 当然这篇博文不会把所有标准都列出来, 只是强调一些比较小的点. 当然这里所说全部都是 $\mathrm{Markdwon}$ 中的 $\LaTeX$ 公式, 也可以说成是 $\mathrm{MathJax}$ , 所以请大佬们轻喷.
积分正确的积分写法应该是
1\int f(x)\,\mathrm&#123;d&#125;x

$$\int f(x),\mathrm{d}x$$
即 $\mathrm{d}x$ 与被积函数之间要有一个小小的间隔 \, , 并且 $\mathrm{d}$ 要用正体.
cdots 还是 ldots ?正确的用法是
11+2+3+\cdots+n

$$1+2+3+\cdots+n$$
11,2,3,\ldots,n

$$1,2,3,\ldots,n$$
即省略号要和它们两边的符号等高. 不过还有一个方便的命令, 即 \dots , 它可以判断应该用哪个省略号.
121+2+3+\dots+n\\\\1,2,3,\dots,n

$$1+2+3+ ...</div></div></div><div class="recent-post-item"><!-- - let post_cover = article.cover--><div class="post_cover right_radius"><a href="/ML/model/LDA/" title="LDA 详解">     <img class="post_bg" src="https://cdn.jsdelivr.net/gh/cnyist/blog/ML/model/LDA/LDA.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="LDA 详解"></a></div><div class="recent-post-info"><a class="article-title" href="/ML/model/LDA/" title="LDA 详解">LDA 详解</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-04-23T10:31:09.000Z" title="发表于 2020-04-23 18:31:09">2020-04-23</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/">机器学习</a><i class="fas fa-angle-right"></i><a class="article-meta__categories" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E6%A8%A1%E5%9E%8B/">模型</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E6%95%B0%E5%AD%A6/">数学</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/">机器学习</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/%E6%A6%82%E7%8E%87%E5%9B%BE%E6%A8%A1%E5%9E%8B/">概率图模型</a></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/ML/model/LDA/#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">先验知识Gamma 函数
Gamma 函数详解

Beta/Dirichlet 分布与共轭
Beta 函数, Beta 分布详解

MCMC, 吉布斯采样这块资料暂时自己去找, 等我有空写了 $\textrm{MCMC}$ 的教程再补上.
LDA 介绍构成&nbsp;$\textrm{LDA (Latent Dirichlet Allocation)}$ 是一种词袋模型. 由语料, 文档, 话题. 词, 这三个概念组成.

语料
语料是文档的集合.

文档
文档是词的集合, 可以看做是一篇作文, 或是像这篇一样的博文, 反正就是一篇完整的文本.

话题
话题给出了某个词出现的概率. 到底是啥呢? $\textrm{LDA}$ 认为, 文档中每个词都应该有它的话题, 词是由话题来生成的. 比如说某个词的话题是 “概率论” , 那么这个词就很有可能是 “$\textrm{Gamma}$ 函数” , 而不太可能是 “吃饭” . “可能” 与 “不太可能” 在数学上用概率描述, 而话题就给出了这个概率的值. 

词

这应该无需多解释, “词” 本身就是一个词. 文档是由一个个词组成的


生 ...</div></div></div><div class="recent-post-item"><!-- - let post_cover = article.cover--><div class="post_cover left_radius"><a href="/hexo/valine_admin/" title="Valine 评论回复增强">     <img class="post_bg" src="https://cdn.jsdelivr.net/gh/cnyist/blog/hexo/valine_admin/valine_admin.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Valine 评论回复增强"></a></div><div class="recent-post-info"><a class="article-title" href="/hexo/valine_admin/" title="Valine 评论回复增强">Valine 评论回复增强</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-04-19T05:25:01.000Z" title="发表于 2020-04-19 13:25:01">2020-04-19</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/Hexo/">Hexo</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E9%97%AE%E9%A2%98/">问题</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/Hexo/">Hexo</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/%E6%90%AD%E5%BB%BA%E7%AB%99%E7%82%B9/">搭建站点</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/Valine/">Valine</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/%E6%95%99%E7%A8%8B/">教程</a></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/hexo/valine_admin/#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">由于 Valine 本身的评论回复并不是很好用, 而且现在的版本甚至已经取消了评论回复的功能, 因此我们需要 Valine-Admin 来增强.
部署首先我推荐使用国际版的 LeanCloud 而不是华东华北节点 (不用身份证绑定域名也不用备案啥的) , 将数据迁移到国际版可以用 LeanCloud 的数据导入导出功能实现, 不过要注意导出功能只能在中午 12 点前使用.
进入你原本的 Valine 评论的 LeanCloud 应用, 选择 云引擎 -&gt; 部署 -&gt; 部署项目 -&gt; Git 源码部署 -&gt; 配置 Git 中填入 https://github.com/DesertsP/Valine-Admin.git , 然后保存.

分支或提交 填入 master  , 然后点击部署

第一次部署需要一点点时间.
配置接下来就是配置了. 进入 云引擎 -&gt; 设置 界面配置环境变量.




变量
值
说明



SITE_NAME

网站名称


SITE_URL

网站地址


SMTP_USER

SMTP 用户名 (一般为你的邮箱)


SMTP_P ...</div></div></div><div class="recent-post-item"><!-- - let post_cover = article.cover--><div class="post_cover right_radius"><a href="/hexo/local_search_speed_up/" title="解决 Hexo 本地搜索 search.xml 文件加载过慢">     <img class="post_bg" src="https://cdn.jsdelivr.net/gh/cnyist/blog/hexo/local_search_speed_up/local_search_speed_up.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="解决 Hexo 本地搜索 search.xml 文件加载过慢"></a></div><div class="recent-post-info"><a class="article-title" href="/hexo/local_search_speed_up/" title="解决 Hexo 本地搜索 search.xml 文件加载过慢">解决 Hexo 本地搜索 search.xml 文件加载过慢</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-04-17T02:23:54.000Z" title="发表于 2020-04-17 10:23:54">2020-04-17</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/Hexo/">Hexo</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E9%97%AE%E9%A2%98/">问题</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/Hexo/">Hexo</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/%E6%90%AD%E5%BB%BA%E7%AB%99%E7%82%B9/">搭建站点</a></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/hexo/local_search_speed_up/#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">问题由于不想使用第三方, 我使用了本地搜索. 但是本地搜索带来的一个问题是, search.xml 太大了, 加载速度缓慢. 如果我们将 search.xml 文件使用外链引用 (例如用 Jsdelivr 加速过的链接) , 就可以解决这个问题.
解决打开主题下的 local-search.js 文件 (不同主题的位置会不同, 但是一般都在 source/js 这种文件夹里) , 找到如下字段
1url: GLOBAL_CONFIG.root + path

改成
1url: 外链

外链推荐使用 Jsdelivr 的 cdn (引用 Github 的资源, 不需要手动更新, 速度也挺快) . 如果你的博客部署在 Github Pages, 那么就可以改成如下形式
1

如果你还不知道什么是 Jsdelivr , 可以看我的这篇文章. 
换了外链后, 速度明显增加, 几乎是秒加载.
</div></div></div><div class="recent-post-item"><!-- - let post_cover = article.cover--><div class="post_cover left_radius"><a href="/hexo/butterfly_modify/" title="Butterfly 主题魔改记录">     <img class="post_bg" src="https://cdn.jsdelivr.net/gh/cnyist/blog/hexo/butterfly_modify/butterfly_modify.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Butterfly 主题魔改记录"></a></div><div class="recent-post-info"><a class="article-title" href="/hexo/butterfly_modify/" title="Butterfly 主题魔改记录">Butterfly 主题魔改记录</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-04-13T03:26:37.000Z" title="发表于 2020-04-13 11:26:37">2020-04-13</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/Hexo/">Hexo</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Hexo/">Hexo</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/%E6%90%AD%E5%BB%BA%E7%AB%99%E7%82%B9/">搭建站点</a></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/hexo/butterfly_modify/#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">记录下我对 Butterfly 主题的魔改, 一方面可供参考, 另一方面可以记录下自己的修改方便查找.
本博客已开源! 请看 Hexo modify theme butterfly. 以下魔改部分集合到魔改主题, 部分已放弃 (不兼容或者其他原因). 如果更改失效, 可能是版本问题, 如果想要尽快使用这些魔改, 最便捷的方式是直接使用我的魔改主题. 魔改主题保留了所有原配置, 所有魔改配置均可关闭.
Mathjax 公式渲染去除滚动条进入 source/css/_layout/third-party.styl , 找到如下内容
12.has-jax  overflow: auto

改成
12.has-jax  overflow: visible

设置半透明效果看我博客. 
进入source/css/_layout/page.styl 文件, 找到以下内容
123456.layout_page  display: flex  align-items: flex-start  margin: 0 auto  padding: 2rem 15px  max-width: 1200px

 ...</div></div></div><div class="recent-post-item"><!-- - let post_cover = article.cover--><div class="post_cover right_radius"><a href="/math/probability_theory/beta/" title="Beta 函数, Beta 分布详解">     <img class="post_bg" src="https://cdn.jsdelivr.net/gh/cnyist/blog/math/probability_theory/beta/beta.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Beta 函数, Beta 分布详解"></a></div><div class="recent-post-info"><a class="article-title" href="/math/probability_theory/beta/" title="Beta 函数, Beta 分布详解">Beta 函数, Beta 分布详解</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-04-13T02:02:05.000Z" title="发表于 2020-04-13 10:02:05">2020-04-13</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E6%95%B0%E5%AD%A6/">数学</a><i class="fas fa-angle-right"></i><a class="article-meta__categories" href="/categories/%E6%95%B0%E5%AD%A6/%E6%A6%82%E7%8E%87%E8%AE%BA/">概率论</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E6%95%B0%E5%AD%A6/">数学</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/%E5%87%BD%E6%95%B0/">函数</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/%E5%88%86%E5%B8%83/">分布</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/%E6%A6%82%E7%8E%87%E8%AE%BA/">概率论</a></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/math/probability_theory/beta/#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">推导第一种&nbsp;$\mathrm{Beta}$ 分布一般被用于建模伯努利试验事件成功的概率的概率分布. 什么叫做伯努利试验事件成功的概率? 我们来举个例子.

如果有一枚硬币, 分为正反两面 (不一定均匀) , 那么假设你抛了 $10$ 次, 正面有 $7$ 次, 那么抛这枚硬币是正面的概率是多少呢? 当然我们一般会说是 $7/10$ , 但这只是最好的估计. 可能是 $1/10$ 吗? 当然可能, 但是可能性不高. 这里的 $7/10$ , $1/10$ 就是所谓伯努利试验事件成功的概率. 而其服从的分布就是伯努利试验事件成功的概率的概率分布.

二项分布相信大家高中就都已经接触过了$$P(x) = \binom{n}{x}q^x(1-q)^{n-x}$$这是已知参数 $n, q$ 来估计 $x$ , 我们同样可以将其等价地写为 $P(x\mid  q)$ . 那如果我们知道了 $n,x$ , 要如何估计 $q$ 呢? 也就是如何求出 $P(q\mid x)$ (省略了 $n$ 是为了方便写公式, 毕竟两个条件概率都是已知 $n$ 的) .
根据贝叶斯公式, 我们有$$P(q\ ...</div></div></div><div class="recent-post-item"><!-- - let post_cover = article.cover--><div class="post_cover left_radius"><a href="/scribble/build_nav/" title="如何快速搭建一个属于自己的网址导航">     <img class="post_bg" src="https://cdn.jsdelivr.net/gh/cnyist/blog/scribble/build_nav/build_nav.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="如何快速搭建一个属于自己的网址导航"></a></div><div class="recent-post-info"><a class="article-title" href="/scribble/build_nav/" title="如何快速搭建一个属于自己的网址导航">如何快速搭建一个属于自己的网址导航</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-04-10T12:02:49.000Z" title="发表于 2020-04-10 20:02:49">2020-04-10</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E6%9D%82%E6%96%87/">杂文</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E6%90%AD%E5%BB%BA%E7%AB%99%E7%82%B9/">搭建站点</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/%E6%95%99%E7%A8%8B/">教程</a></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/scribble/build_nav/#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">收藏夹内容太多, 有时候不方便找, 那么这时你就需要一个网址导航来放你的收藏夹的内容啦! 我知道理由很牵强, 反正就是要搭网址导航, 理由什么的自己去想. 这篇博文默认你已经注册了 Github .
Fork 网址导航项目项目地址
开启 Pages 服务
进入到你 Fork 后的仓库, 进入 Settings, 拉到下面开启 GitHub Pages.
此时, 你的网址导航已经成功建立, 可以根据上面的 “Your site is published at https://xxxx.xxx&quot;
 来进入你的网址导航. 如果要自定义域名, 可以在下面那个 “Custom domain” 框框里写上你自己的域名, 然后设置 CNAME 域名解析记录到 用户名.github.io . 就可以用你自己的域名访问网址导航了.
修改内容这个网址导航现在还不能算是你 “自己的” , 因此可以修改 index.html 来修改其成为你自己个性的网址导航. 修改的过程我就不细说了, 无非就是修改 favicon, title 这些的. 但是修改其中网址导航的网站可不是一件简单的工作, 一不留神就 ...</div></div></div><div class="recent-post-item"><!-- - let post_cover = article.cover--><div class="post_cover right_radius"><a href="/hexo/back_blog_up/" title="手把手教你将博客备份到 Github">     <img class="post_bg" src="https://cdn.jsdelivr.net/gh/cnyist/blog/hexo/back_blog_up/back_blog_up.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="手把手教你将博客备份到 Github"></a></div><div class="recent-post-info"><a class="article-title" href="/hexo/back_blog_up/" title="手把手教你将博客备份到 Github">手把手教你将博客备份到 Github</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-04-10T05:22:34.000Z" title="发表于 2020-04-10 13:22:34">2020-04-10</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/Git/">Git</a><i class="fas fa-angle-right"></i><a class="article-meta__categories" href="/categories/Hexo/">Hexo</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Git/">Git</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/Hexo/">Hexo</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/%E6%90%AD%E5%BB%BA%E7%AB%99%E7%82%B9/">搭建站点</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/%E6%95%99%E7%A8%8B/">教程</a></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/hexo/back_blog_up/#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">如果由于某些原因, 你把博客源文件弄丢了. 要是有备份, 那么就可以迅速恢复过来, 要是没有… 那你辛辛苦苦写的好几十篇博文就可能毁于一旦. 所以备份是很重要的. 那么要备份到哪呢? 这里我推荐 Github , 方便快捷, 而且不怕跑路.

初始化首先, 进入博客根目录执行
1git init

然后就会在目录下生成一个 .git 文件. 
创建 Github 仓库进入你的 Github , 新建一个仓库, 复制该仓库的 SSH url .
添加远程仓库回到博客根目录, 执行
1git remote add origin git@github.com:xxx/xxx  // 即你的 SSH url

然后
123git add *  // 这一步可能会报错, 如果报错换成 `git add * -f` 再试试git commit -m &quot;想写啥就写啥, 反正不能不写&quot;git push origin master  // 如果报错, 可以直接强制 push 即 `git push -f origin master`

然后你就发现 Github 仓库多了你的源文件. ...</div></div></div><nav id="pagination"><div class="pagination"><a class="extend prev" rel="prev" href="/page/6/"><i class="fas fa-chevron-left fa-fw"></i></a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/6/">6</a><span class="page-number current">7</span><a class="page-number" href="/page/8/">8</a><span class="space">&hellip;</span><a class="page-number" href="/page/10/">10</a><a class="extend next" rel="next" href="/page/8/"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="card-info-avatar is-center"><img class="avatar-img" src="https://cdn.jsdelivr.net/gh/cnyist/blog/img/avatar.svg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/><div class="author-info__name">云玩家</div><div class="author-info__description">云玩家's blog</div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">97</div></a></div><div class="card-info-data-item is-center"><a href="/tags/"><div class="headline">标签</div><div class="length-num">40</div></a></div><div class="card-info-data-item is-center"><a href="/categories/"><div class="headline">分类</div><div class="length-num">27</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/cnyist" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="https://blog.csdn.net/chnyist" target="_blank" title="CSDN"><i class="fas iconfont icon-CN_csdnnet"></i></a><a class="social-icon" href="https://www.zhihu.com/people/cnyist" target="_blank" title="知乎"><i class="fas iconfont icon-zhihu"></i></a><a class="social-icon" href="mailto:yunist@qq.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><!-- - let post_cover = article.cover--><div class="aside-list-item"><a class="thumbnail" href="/math/set_theory/unique_ordinal/" title="序数的唯一性"><img src="https://cdn.jsdelivr.net/gh/cnyist/blog/math/set_theory/unique_ordinal/unique_ordinal.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="序数的唯一性"/></a><div class="content"><a class="title" href="/math/set_theory/unique_ordinal/" title="序数的唯一性">序数的唯一性</a><time datetime="2022-01-12T08:26:12.000Z" title="发表于 2022-01-12 16:26:12">2022-01-12</time></div></div><!-- - let post_cover = article.cover--><div class="aside-list-item"><a class="thumbnail" href="/math/mathematical_analysis/mathematical_analysis_practice/3/3-1/" title="(史济怀) 数学分析教程上册第 3 版-练习题 3.1"><img src="https://cdn.jsdelivr.net/gh/cnyist/blog/math/mathematical_analysis/mathematical_analysis_practice/3/3-1/math.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="(史济怀) 数学分析教程上册第 3 版-练习题 3.1"/></a><div class="content"><a class="title" href="/math/mathematical_analysis/mathematical_analysis_practice/3/3-1/" title="(史济怀) 数学分析教程上册第 3 版-练习题 3.1">(史济怀) 数学分析教程上册第 3 版-练习题 3.1</a><time datetime="2021-10-19T00:30:55.000Z" title="发表于 2021-10-19 08:30:55">2021-10-19</time></div></div><!-- - let post_cover = article.cover--><div class="aside-list-item"><a class="thumbnail" href="/math/mathematical_analysis/mathematical_analysis_practice/2/2-11/" title="(史济怀) 数学分析教程上册第 3 版-练习题 2.11"><img src="https://cdn.jsdelivr.net/gh/cnyist/blog/math/mathematical_analysis/mathematical_analysis_practice/2/2-11/2-11.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="(史济怀) 数学分析教程上册第 3 版-练习题 2.11"/></a><div class="content"><a class="title" href="/math/mathematical_analysis/mathematical_analysis_practice/2/2-11/" title="(史济怀) 数学分析教程上册第 3 版-练习题 2.11">(史济怀) 数学分析教程上册第 3 版-练习题 2.11</a><time datetime="2021-09-25T03:37:28.000Z" title="发表于 2021-09-25 11:37:28">2021-09-25</time></div></div><!-- - let post_cover = article.cover--><div class="aside-list-item"><a class="thumbnail" href="/math/mathematical_analysis/mathematical_analysis_practice/2/2-10/" title="(史济怀) 数学分析教程上册第 3 版-练习题 2.10"><img src="https://cdn.jsdelivr.net/gh/cnyist/blog/math/mathematical_analysis/mathematical_analysis_practice/2/2-10/2-10.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="(史济怀) 数学分析教程上册第 3 版-练习题 2.10"/></a><div class="content"><a class="title" href="/math/mathematical_analysis/mathematical_analysis_practice/2/2-10/" title="(史济怀) 数学分析教程上册第 3 版-练习题 2.10">(史济怀) 数学分析教程上册第 3 版-练习题 2.10</a><time datetime="2021-09-22T07:36:49.000Z" title="发表于 2021-09-22 15:36:49">2021-09-22</time></div></div><!-- - let post_cover = article.cover--><div class="aside-list-item"><a class="thumbnail" href="/math/mathematical_analysis/mathematical_analysis_practice/2/2-9/" title="(史济怀) 数学分析教程上册第 3 版-练习题 2.9"><img src="https://cdn.jsdelivr.net/gh/cnyist/blog/math/mathematical_analysis/mathematical_analysis_practice/2/2-9/2-9.jpeg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="(史济怀) 数学分析教程上册第 3 版-练习题 2.9"/></a><div class="content"><a class="title" href="/math/mathematical_analysis/mathematical_analysis_practice/2/2-9/" title="(史济怀) 数学分析教程上册第 3 版-练习题 2.9">(史济怀) 数学分析教程上册第 3 版-练习题 2.9</a><time datetime="2021-09-20T08:19:06.000Z" title="发表于 2021-09-20 16:19:06">2021-09-20</time></div></div></div></div><div class="card-widget" id="card-newest-comments"><div class="item-headline"><i class="fas fa-bolt"></i><span>最新评论</span></div><div class="aside-list"><span>正在加载中...</span></div></div><div class="card-widget card-categories"><div class="item-headline">
            <i class="fas fa-folder-open"></i>
            <span>分类</span>
            
            </div>
            <ul class="card-category-list" id="aside-cat-list">
            <li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Git/"><span class="card-category-list-name">Git</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Hexo/"><span class="card-category-list-name">Hexo</span><span class="card-category-list-count">11</span></a></li><li class="card-category-list-item parent"><a class="card-category-list-link" href="/categories/Python/"><span class="card-category-list-name">Python</span><span class="card-category-list-count">12</span><i class="fas fa-caret-left "></i></a><ul class="card-category-list child"><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Python/Jupyter/"><span class="card-category-list-name">Jupyter</span><span class="card-category-list-count">3</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Python/Numpy/"><span class="card-category-list-name">Numpy</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Python/%E5%85%B6%E4%BB%96/"><span class="card-category-list-name">其他</span><span class="card-category-list-count">1</span></a></li></ul></li><li class="card-category-list-item parent"><a class="card-category-list-link" href="/categories/%E6%95%B0%E5%AD%A6/"><span class="card-category-list-name">数学</span><span class="card-category-list-count">35</span><i class="fas fa-caret-left "></i></a><ul class="card-category-list child"><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%95%B0%E5%AD%A6/%E5%85%B6%E4%BB%96/"><span class="card-category-list-name">其他</span><span class="card-category-list-count">6</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%95%B0%E5%AD%A6/%E6%95%B0%E5%AD%A6%E5%88%86%E6%9E%90/"><span class="card-category-list-name">数学分析</span><span class="card-category-list-count">22</span></a><ul class="card-category-list child"><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%95%B0%E5%AD%A6/%E6%95%B0%E5%AD%A6%E5%88%86%E6%9E%90/%E6%95%B0%E5%AD%A6%E5%88%86%E6%9E%90%E6%95%99%E7%A8%8B/"><span class="card-category-list-name">数学分析教程</span><span class="card-category-list-count">22</span></a></li></ul></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%95%B0%E5%AD%A6/%E6%A6%82%E7%8E%87%E8%AE%BA/"><span class="card-category-list-name">概率论</span><span class="card-category-list-count">3</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%95%B0%E5%AD%A6/%E7%BA%BF%E6%80%A7%E4%BB%A3%E6%95%B0/"><span class="card-category-list-name">线性代数</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%95%B0%E5%AD%A6/%E9%9B%86%E5%90%88%E8%AE%BA/"><span class="card-category-list-name">集合论</span><span class="card-category-list-count">1</span></a></li></ul></li><li class="card-category-list-item parent"><a class="card-category-list-link" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/"><span class="card-category-list-name">机器学习</span><span class="card-category-list-count">35</span><i class="fas fa-caret-left "></i></a><ul class="card-category-list child"><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E4%BC%98%E5%8C%96%E7%AE%97%E6%B3%95/"><span class="card-category-list-name">优化算法</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E5%BC%BA%E5%8C%96%E5%AD%A6%E4%B9%A0/"><span class="card-category-list-name">强化学习</span><span class="card-category-list-count">17</span></a><ul class="card-category-list child"><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E5%BC%BA%E5%8C%96%E5%AD%A6%E4%B9%A0/Spinning-Up/"><span class="card-category-list-name">Spinning Up</span><span class="card-category-list-count">3</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E5%BC%BA%E5%8C%96%E5%AD%A6%E4%B9%A0/%E3%80%8A%E5%BC%BA%E5%8C%96%E5%AD%A6%E4%B9%A0%E3%80%8B/"><span class="card-category-list-name">《强化学习》</span><span class="card-category-list-count">6</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E5%BC%BA%E5%8C%96%E5%AD%A6%E4%B9%A0/%E5%85%A5%E9%97%A8/"><span class="card-category-list-name">入门</span><span class="card-category-list-count">8</span></a></li></ul></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E6%A1%86%E6%9E%B6/"><span class="card-category-list-name">框架</span><span class="card-category-list-count">1</span></a><ul class="card-category-list child"><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E6%A1%86%E6%9E%B6/Pytorch/"><span class="card-category-list-name">Pytorch</span><span class="card-category-list-count">1</span></a></li></ul></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E6%A8%A1%E5%9E%8B/"><span class="card-category-list-name">模型</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E8%A5%BF%E7%93%9C%E4%B9%A6/"><span class="card-category-list-name">西瓜书</span><span class="card-category-list-count">15</span></a><ul class="card-category-list child"><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E8%A5%BF%E7%93%9C%E4%B9%A6/%E4%B9%A0%E9%A2%98/"><span class="card-category-list-name">习题</span><span class="card-category-list-count">7</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E8%A5%BF%E7%93%9C%E4%B9%A6/%E4%BB%A3%E7%A0%81%E5%AE%9E%E4%BE%8B/"><span class="card-category-list-name">代码实例</span><span class="card-category-list-count">6</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/%E8%A5%BF%E7%93%9C%E4%B9%A6/%E8%AF%BB%E6%87%82%E8%A5%BF%E7%93%9C%E4%B9%A6/"><span class="card-category-list-name">读懂西瓜书</span><span class="card-category-list-count">2</span></a></li></ul></li></ul></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%9D%82%E6%96%87/"><span class="card-category-list-name">杂文</span><span class="card-category-list-count">8</span></a></li>
            </ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/tags/Blog/" style="font-size: 1.1em; color: #999">Blog</a> <a href="/tags/Git/" style="font-size: 1.13em; color: #999a9c">Git</a> <a href="/tags/Gym/" style="font-size: 1.1em; color: #999">Gym</a> <a href="/tags/Hexo/" style="font-size: 1.27em; color: #99a0a9">Hexo</a> <a href="/tags/Jupyter/" style="font-size: 1.17em; color: #999c9f">Jupyter</a> <a href="/tags/LaTeX/" style="font-size: 1.13em; color: #999a9c">LaTeX</a> <a href="/tags/Numpy/" style="font-size: 1.13em; color: #999a9c">Numpy</a> <a href="/tags/Python/" style="font-size: 1.3em; color: #99a1ac">Python</a> <a href="/tags/Pytorch/" style="font-size: 1.17em; color: #999c9f">Pytorch</a> <a href="/tags/Spinning-Up/" style="font-size: 1.13em; color: #999a9c">Spinning Up</a> <a href="/tags/Valine/" style="font-size: 1.17em; color: #999c9f">Valine</a> <a href="/tags/%E4%B8%8D%E7%AD%89%E5%BC%8F/" style="font-size: 1.1em; color: #999">不等式</a> <a href="/tags/%E4%B9%A0%E9%A2%98/" style="font-size: 1.43em; color: #99a6b9">习题</a> <a href="/tags/%E4%BB%A3%E7%A0%81%E5%AE%9E%E4%BE%8B/" style="font-size: 1.23em; color: #999ea6">代码实例</a> <a href="/tags/%E4%BC%98%E5%8C%96%E7%AE%97%E6%B3%95/" style="font-size: 1.17em; color: #999c9f">优化算法</a> <a href="/tags/%E5%85%AC%E7%90%86/" style="font-size: 1.1em; color: #999">公理</a> <a href="/tags/%E5%87%BD%E6%95%B0/" style="font-size: 1.13em; color: #999a9c">函数</a> <a href="/tags/%E5%88%86%E5%B8%83/" style="font-size: 1.13em; color: #999a9c">分布</a> <a href="/tags/%E5%8D%9A%E5%BC%88%E8%AE%BA/" style="font-size: 1.1em; color: #999">博弈论</a> <a href="/tags/%E5%9C%86%E9%94%A5%E6%9B%B2%E7%BA%BF/" style="font-size: 1.1em; color: #999">圆锥曲线</a> <a href="/tags/%E5%A4%8D%E6%95%B0/" style="font-size: 1.1em; color: #999">复数</a> <a href="/tags/%E5%BC%BA%E5%8C%96%E5%AD%A6%E4%B9%A0/" style="font-size: 1.37em; color: #99a4b2">强化学习</a> <a href="/tags/%E6%90%AD%E5%BB%BA%E7%AB%99%E7%82%B9/" style="font-size: 1.27em; color: #99a0a9">搭建站点</a> <a href="/tags/%E6%95%99%E7%A8%8B/" style="font-size: 1.23em; color: #999ea6">教程</a> <a href="/tags/%E6%95%B0%E5%AD%A6/" style="font-size: 1.5em; color: #99a9bf">数学</a> <a href="/tags/%E6%95%B0%E5%AD%A6%E5%88%86%E6%9E%90/" style="font-size: 1.4em; color: #99a5b6">数学分析</a> <a href="/tags/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/" style="font-size: 1.47em; color: #99a8bc">机器学习</a> <a href="/tags/%E6%9E%81%E9%99%90/" style="font-size: 1.1em; color: #999">极限</a> <a href="/tags/%E6%A1%86%E6%9E%B6/" style="font-size: 1.1em; color: #999">框架</a> <a href="/tags/%E6%A6%82%E7%8E%87%E5%9B%BE%E6%A8%A1%E5%9E%8B/" style="font-size: 1.13em; color: #999a9c">概率图模型</a> <a href="/tags/%E6%A6%82%E7%8E%87%E8%AE%BA/" style="font-size: 1.17em; color: #999c9f">概率论</a> <a href="/tags/%E6%B0%B4%E6%96%87/" style="font-size: 1.13em; color: #999a9c">水文</a> <a href="/tags/%E7%99%BD%E5%AB%96/" style="font-size: 1.13em; color: #999a9c">白嫖</a> <a href="/tags/%E7%BA%BF%E6%80%A7%E4%BB%A3%E6%95%B0/" style="font-size: 1.13em; color: #999a9c">线性代数</a> <a href="/tags/%E8%8B%B1%E8%AF%AD/" style="font-size: 1.1em; color: #999">英语</a> <a href="/tags/%E8%A5%BF%E7%93%9C%E4%B9%A6/" style="font-size: 1.33em; color: #99a2af">西瓜书</a> <a href="/tags/%E8%AE%BA%E6%96%87/" style="font-size: 1.1em; color: #999">论文</a> <a href="/tags/%E8%AE%BA%E6%96%87%E7%B2%BE%E8%AF%BB/" style="font-size: 1.13em; color: #999a9c">论文精读</a> <a href="/tags/%E9%97%AE%E9%A2%98/" style="font-size: 1.2em; color: #999da3">问题</a> <a href="/tags/%E9%9B%86%E5%90%88%E8%AE%BA/" style="font-size: 1.1em; color: #999">集合论</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span><a class="card-more-btn" href="/archives/" title="查看更多">
    <i class="fas fa-angle-right"></i></a></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/01/"><span class="card-archive-list-date">一月 2022</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/10/"><span class="card-archive-list-date">十月 2021</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/09/"><span class="card-archive-list-date">九月 2021</span><span class="card-archive-list-count">7</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/08/"><span class="card-archive-list-date">八月 2021</span><span class="card-archive-list-count">7</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/07/"><span class="card-archive-list-date">七月 2021</span><span class="card-archive-list-count">4</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/06/"><span class="card-archive-list-date">六月 2021</span><span class="card-archive-list-count">10</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/05/"><span class="card-archive-list-date">五月 2021</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/04/"><span class="card-archive-list-date">四月 2021</span><span class="card-archive-list-count">3</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">97</div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2022-01-14T05:28:38.754Z"></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2022 By 云玩家</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer><script>document.getElementById('web_bg').style = 'background-image: url("' + get_rand_jsd_pic('cnyist', 'banner@master', '/', 70, '-min.jpg') + '")'</script></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><div class="search-dialog__title" id="local-search-title">本地搜索</div><div id="local-input-panel"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div></div><hr/><div id="local-search-results"></div><span class="search-close-button"><i class="fas fa-times"></i></span></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/search/local-search.js"></script><div class="js-pjax"><script>(() => { 
  const getCommentUrl = () => {
    const eleGroup = document.querySelectorAll('#recent-posts .article-title')
    let urlArray = []
    eleGroup.forEach(i=>{
      urlArray.push(i.getAttribute('href'))
    })
    return urlArray
  }

  const getCount = () => {
    const runTwikoo = () => {
      twikoo.getCommentsCount({
        envId: 'yunist-147dfe',
        region: '',
        urls: getCommentUrl(),
        includeReply: false
      }).then(function (res) {
        document.querySelectorAll('#recent-posts .twikoo-count').forEach((item,index) => {
          item.innerText = res[index].count
        })
      }).catch(function (err) {
        console.log(err)
      })
    }

      if (typeof twikoo === 'object') {
        runTwikoo()
      } else {
        getScript('https://cdn.jsdelivr.net/npm/twikoo/dist/twikoo.all.min.js').then(runTwikoo)
      }
  }

  window.pjax ? getCount() : window.addEventListener('load', getCount)

})()</script><script>function subtitleType () {
  if (true) { 
    var typed = new Typed("#subtitle", {
      strings: "虽于果壳内&#44; 我亦无限王.,大胆地猜想&#44; 小心地求证.,进化是修补匠&#44; 而非工程师.,严谨换来的是无穷的想象.,一门科学只有当它达到了能够成功地运用数学时&#44; 才算真正发展了.,无限! 再也没有其他问题如此深刻地打动过人类的心灵.,用一&#44; 从无&#44; 可生万物.,数字不会说谎&#44 但说谎的人会想出办法.,只要你对数据进行严刑拷打&#44 他会招出任何你想要的信息.,The devils are in the details!,Garbage in&#44; garbage out.".split(","),
      startDelay: 300,
      typeSpeed: 150,
      loop: true,
      backSpeed: 50
    })
  } else {
    document.getElementById("subtitle").innerHTML = '虽于果壳内&#44; 我亦无限王.'
  }
}

if (true) {
  if (typeof Typed === 'function') {
    subtitleType()
  } else {
    getScript('https://cdn.jsdelivr.net/npm/typed.js/lib/typed.min.js').then(subtitleType)
  }
} else {
  subtitleType()
}</script></div><script>window.addEventListener('load', () => {
  const changeContent = (content) => {
    if (content === '') return content

    content = content.replace(/<img.*?src="(.*?)"?[^\>]+>/ig, '[图片]') // replace image link
    content = content.replace(/<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi, '[链接]') // replace url
    content = content.replace(/<pre><code>.*?<\/pre>/gi, '[代码]') // replace code
    content = content.replace(/<[^>]+>/g,"") // remove html tag

    if (content.length > 150) {
      content = content.substring(0,150) + '...'
    }
    return content
  }

  const getComment = () => {
    const runTwikoo = () => {
      twikoo.getRecentComments({
        envId: 'yunist-147dfe',
        region: '',
        pageSize: 6,
        includeReply: true
      }).then(function (res) {
        const twikooArray = res.map(e => {
          return {
            'content': changeContent(e.comment),
            'avatar': e.avatar,
            'nick': e.nick,
            'url': e.url + '#' + e.id,
            'date': new Date(e.created).toISOString()
          }
        })

        saveToLocal.set('twikoo-newest-comments', JSON.stringify(twikooArray), 10/(60*24))
        generateHtml(twikooArray)
      }).catch(function (err) {
        const $dom = document.querySelector('#card-newest-comments .aside-list')
        $dom.innerHTML= "无法获取评论，请确认相关配置是否正确"
      })
    }

    if (typeof twikoo === 'object') {
      runTwikoo()
    } else {
      getScript('https://cdn.jsdelivr.net/npm/twikoo/dist/twikoo.all.min.js').then(runTwikoo)
    }
  }

  const generateHtml = array => {
    let result = ''

    if (array.length) {
      for (let i = 0; i < array.length; i++) {
        result += '<div class=\'aside-list-item\'>'

        if (true) {
          const name = 'src'
          result += `<a href='${array[i].url}' class='thumbnail'><img ${name}='${array[i].avatar}' alt='${array[i].nick}'></a>`
        }
        
        result += `<div class='content'>
        <a class='comment' href='${array[i].url}'>${array[i].content}</a>
        <div class='name'><span>${array[i].nick} / </span><time datetime="${array[i].date}">${btf.diffDate(array[i].date, true)}</time></div>
        </div></div>`
      }
    } else {
      result += '没有评论'
    }

    let $dom = document.querySelector('#card-newest-comments .aside-list')
    $dom.innerHTML= result
    window.lazyLoadInstance && window.lazyLoadInstance.update()
    window.pjax && window.pjax.refresh($dom)
  }

  const newestCommentInit = () => {
    if (document.querySelector('#card-newest-comments .aside-list')) {
      const data = saveToLocal.get('twikoo-newest-comments')
      if (data) {
        generateHtml(JSON.parse(data))
      } else {
        getComment()
      }
    }
  }

  newestCommentInit()
  document.addEventListener('pjax:complete', newestCommentInit)
})</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>